package Thread.timer;

import java.util.Timer;
import java.util.TimerTask;

/**
 * java中定时器的简单认识
 */
public class TimerTest {
    public static void main(String[] args) {
        Timer timer=new Timer();
        //表示3秒之后执行此任务
        timer.schedule(new TimerTask() {
            @Override
            public void run() {
                System.out.println("hello~~~");
            }
        },3000);
    }
}
